<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="pragma" content="no-cache">
    <title>添加助管信息</title>
    <meta name="description" content="">
    <meta name="keywords" content="">
    <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
    <link href="css/style.css" rel="stylesheet">
</head>

<body>
    <div id="dept-data" class="">
        <div class="panel panel-default">
            <div class="panel-body">
                <div class="row">
                    <div class="col-sm-10">
                        <div class="col-sm-3">
                            <label>部门名称：</label>
                            <select v-model="select_deptNo" class="form-control" name="dept">
                                <option v-bind:value="dept.deptId" v-for="dept in depts">{{ dept.deptName }}</option>
                            </select>
                        </div>
                    </div>
                    <div class="col-sm-2">
                        <button class="btn btn-default" v-on:click="queryData">查询</button>
                    </div>
                </div>
            </div>
        </div>
        <div class="panel panel-default">
            <div class="panel-heading">部门信息列表</div>
            <div class="panel-body">
                <table class="table table-bordered mt-10">
                    <tr>
                        <th>部门编号</th>
                        <th>部门名称</th>
                        <th>岗位总数</th>
                        <th>操作</th>
                    </tr>
                    <tr v-for="item in items" track-by="$index">
                        <td>{{item.deptId}}</td>
                        <td>{{item.deptName}}</td>
                        <td>{{item.jobNum}}</td>
                        <td>
                            <button class="btn btn-default" data-toggle="modal" data-target="#myModal-delete" v-on:click="deleteInfo(item.deptId,item.deptName)">删除</button>
                            <button class="btn btn-default" data-toggle="modal" data-target="#myModal-edit" v-on:click="editInfo(item.deptId,item.deptName)">修改</button>
                        </td>
                    </tr>
                </table>
                <button class="btn btn-default" data-toggle="modal" data-target="#myModal-add">添加</button>
                <nav>
                    <ul class="pagination">
                        <li v-bind:class="{'disabled': page.disabled, 'active': page.active }" v-for="page in pages"><a v-on:click="submitPage(page.content)">{{page.content}}</a></li>
                    </ul>
                </nav>
            </div>
        </div>
        <!-- 删除模态框（Modal） -->
        <div class="modal fade" id="myModal-delete" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h4 class="modal-title" id="myModalLabel">删除部门信息</h4>
                    </div>
                    <div class="modal-body">
                        <p>确认删除部门：{{deleteItem.deptName}}</p>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                        <button type="button" v-on:click="deleteDept" class="btn btn-primary">提交更改</button>
                    </div>
                </div>
                <!-- /.modal-content -->
            </div>
            <!-- /.modal -->
        </div>
        <!-- 修改模态框 -->
        <div class="modal fade" id="myModal-edit" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h4 class="modal-title" id="myModalLabel">修改部门信息</h4>
                    </div>
                    <div class="modal-body">
                        <label for="">部门编号：</label>
                        <input type="text" class="form-control" v-model="editItem.deptID" disabled="">
                        <label for="">部门名称：</label>
                        <input v-model="editItem.deptName" type="text" class="form-control" placeholder="" disabled="">
                        <label for="">部门总数：</label>
                        <input v-model="editItem.jobNum" type="text" class="form-control" placeholder="">
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                        <button type="button" v-on:click="editDept()" class="btn btn-primary">确认</button>
                    </div>
                </div>
                <!-- /.modal-content -->
            </div>
            <!-- /.modal -->
        </div>
        <!-- 添加信息模态框 -->
        <div class="modal fade" id="myModal-add" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h4 class="modal-title" id="myModalLabel">添加部门信息</h4>
                    </div>
                    <div class="modal-body">
                        <label for="">部门编号：</label>
                        <input v-model="addItem.deptID" type="text" class="form-control" placeholder="">
                        <label for="">部门名称：</label>
                        <input v-model="addItem.deptName" type="text" class="form-control" placeholder="">
                        <label for="">岗位总数：</label>
                        <input v-model="addItem.jobNum" type="text" class="form-control" placeholder="">
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                        <a v-on:click="addDept" class="btn btn-primary">添加</a>
                    </div>
                </div>
                <!-- /.modal-content -->
            </div>
            <!-- /.modal -->
        </div>
    </div>
</body>
<script type="text/javascript" src="js/dist/jquery-2.2.4.js"></script>
<script type="text/javascript" src="js/dist/bootstrap.min.js"></script>
<script type="text/javascript" src="js/dist/vue.js"></script>
<script type="text/javascript" data-main="js/dept.js" src="js/dist/require.js"></script>
<!-- <script type="text/javascript" main-data="js/dept.js" src="js/dist/require.js"></script> -->

</html>
